import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect:'/sys-admin', //重定向，如果要访问'/'这个路径， 会跳转到此路径
    children: [
      {
        path: '/sys-admin',
        component: () => import('../views/sys-admin/SystemAdminIndex.vue')
      },
      {
        path: '/sys-admin/main/course/list',
        component: () => import('../views/sys-admin/main/CourseListView.vue')
      },
      {
        path: '/sys-admin/main/course/update',
        component: () => import('../views/sys-admin/main/CourseUpdateView.vue')
      },
      {
        path: '/sys-admin/main/course/search',
        component: () => import('../views/sys-admin/main/CourseSearchView.vue')
      },
      {
        path: '/sys-admin/main/teacher/list',
        component: () => import('../views/sys-admin/main/TeacherListView.vue')
      },
      {
        path: '/sys-admin/main/teacher/insert',
        component: () => import('../views/sys-admin/main/TeacherInsertView.vue')
      },
      {
        path: '/sys-admin/main/teacher/search',
        component: () => import('../views/sys-admin/main/TeacherSelectView')
      },
      {
        path: '/sys-admin/main/teacher/teach',
        component: () => import('../views/sys-admin/main/TeacherTeachView')
      },
      {
        path: '/sys-admin/main/student/insert',
        component: () => import('../views/sys-admin/main/StudentInsertView')
      },
      {
        path: '/sys-admin/main/student/list',
        component: () => import('../views/sys-admin/main/StudentListView')
      },
      {
        path: '/sys-admin/main/student/dropInsert',
        component: () => import('../views/sys-admin/main/DropStudentInsertView')
      },
      {
        path: '/sys-admin/main/student/dropList',
        component: () => import('../views/sys-admin/main/DropStudentListView')
      },
      {
        path: '/sys-admin/main/student/dropDetail',
        component: () => import('../views/sys-admin/main/DropStudentDetailView')
      },
      {
        path: '/sys-admin/main/news/add-new',
        component: () => import('../views/sys-admin/main/NewsAddNewView.vue')
      },
      {
        path: '/sys-admin/main/news/list',
        component: () => import('../views/sys-admin/main/NewsListView.vue')
      },
      {
        path: '/sys-admin/main/teacher/update',
        component: () => import('../views/sys-admin/main/TeacherUpdateView.vue')
      },
      {
        path: '/sys-admin/main/faculty/insert',
        component: () => import('../views/sys-admin/main/FacultyAddNewView.vue')
      },
      {
        path: '/sys-admin/main/faculty/list',
        component: () => import('../views/sys-admin/main/FacultyList.vue')
      },
      {
        path: '/sys-admin/main/major/insert',
        component: () => import('../views/sys-admin/main/MajorAddNewView.vue')
      },
      {
        path: '/sys-admin/main/major/list',
        component: () => import('../views/sys-admin/main/MajorList.vue')
      },
      {
        path: '/sys-admin/main/grade/list',
        component: () => import('../views/sys-admin/main/GradeList.vue')
      },

    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
